package com.chen.facemanager.exception;

import org.apache.commons.lang3.StringUtils;

/**
 * @ClassName ErrorCodeEnum
 * @Description
 * @Author Mr-CHEN
 * @Date 2019/9/5 0005 11:03
 * @Version V1.0
 **/

public enum  ErrorCodeEnum {
    SYS_ERROE("SYS_ERROR","系统错误");

    private String code;
    private String desc;

    ErrorCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }


    public String getDesc() {
        return desc;
    }


    public static ErrorCodeEnum getByVale(String code){
        for (ErrorCodeEnum res :values()){
            if (StringUtils.equals(res.getCode(),code)){
                return res;
            }
        }
        return null;
    }
}